<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  
  <meta name="generator" content="Hugo 0.98.0" />

  
  <meta name="description" content="走在通往幸福的路上">
  

  
  <link rel="apple-touch-icon" sizes="180x180" href="https://blog.v5u.win/apple-touch-icon.png">

  
  <link rel="icon" type="image/png" sizes="32x32" href="https://blog.v5u.win/favicon-32x32.png">

  
  <link rel="icon" type="image/png" sizes="16x16" href="https://blog.v5u.win/favicon-16x16.png">

  
  <link rel="manifest" href="https://blog.v5u.win/site.webmanifest">

  
  <link rel="mask-icon" href="https://blog.v5u.win/safari-pinned-tab.svg" color="">

  <meta name="msapplication-TileColor" content="">

  <meta name="theme-color" content="">

  
  <link rel="stylesheet" href="https://blog.v5u.win/css/bootstrap.min.css" />

  
  <title>appledoc使用说明 | 为吾优</title>
  

  <style>
body {
  min-width: 300px;
}

.custom-navbar {
  margin-bottom: 1em;
  height: 60px;
}

.custom-navbar a {
  display: inline-block; 
  padding: 18px 0;
  margin-right: 1em; 
  font-weight: bold; 
}

.custom-navbar a:hover,
.custom-navbar a:focus {
  text-decoration: none; 
}

@media print {
  .custom-navbar {
    display: none;
  }
}

article {
  padding-bottom: 1em;
}

img {
  max-width: 100%;
}


body {
  background-color: #fff;
}



body {
  color: #212529;
}



a {
  color: #007bff;
}



a:hover,
a:focus {
  color: #0056b3;
}



.custom-navbar {
  background-color: #212529;
}



.custom-navbar a {
  color: rgba(255,255,255,.75);
}



.custom-navbar a:hover,
.custom-navbar a:focus {
  color: rgba(255,255,255,1);
}



.container {
  max-width: 800px;
}





</style>
</head>

<body>
  <nav class="custom-navbar">
  <div class="container">
    
    <a href="/">文章</a>
    
    <a href="/tags/">标签</a>
    
    <a href="/about/">关于</a>
    
    <a href="/index.xml">RSS</a>
    
  </div>
</nav>
  
  <div class="container">
    <article>
      <h1>appledoc使用说明</h1>
<p>appledoc使用说明</p>
<p>安装命令行：</p>
<ul>
<li>git clone git://github.com/tomaz/appledoc.git</li>
<li>cd ./appledoc</li>
<li>sudo sh install-appledoc.sh</li>
<li>appledoc —version //检查successed</li>
</ul>
<p>使用</p>
<p>生成HTML</p>
<p>当需要html文档时，可以加上“–no-create-docset”——</p>
<pre><code>appledoc --no-create-docset --output ~/doc --project-name &quot;DrowRect&quot; --company-id &quot;com.jinyuyoulong&quot; --project-company &quot;jinyuyoulong&quot; ./
</code></pre>
<p>注:</p>
<p>–output ./doc：设置输出目录为“./doc”。</p>
<p>–project-name objcdoc：设置项目名为“DrowRect”。</p>
<p>–project-company “jinyuyoulong”：设置公司名为“jinyuyoulong”。</p>
<p>–company-id “com.jinyuyoulong”：设置公司id为“com.jinyuyoulong”。</p>
<p>./：当前目录。</p>
<p>生成docset 此路不通</p>
<pre><code>appledoc --output ./doc --project-name &quot;DrowRect&quot; --project-company &quot;jinyuyoulong&quot; --company-id &quot;com.jinyuyoulong&quot; ./
</code></pre>
<ul>
<li>
<ul>
<li>*Xcode脚本生成文档</li>
</ul>
</li>
</ul>
<p>Xcode 配置<!-- raw HTML omitted --></p>
<ol>
<li>
<p>add new target —&gt;选择Other—Aggregate，命名为docText<!-- raw HTML omitted --></p>
</li>
<li>
<p>Build Phases + run script</p>
</li>
<li>
<p>编辑run script的内容</p>
</li>
<li>
<p>设置target为docText，运行Xcode</p>
</li>
<li>
<p>在脚本中标明的导出目录下查看生成的文档</p>
</li>
</ol>
<p>script:</p>
<pre><code>#appledoc Xcode script
# Start constants
company=&quot;abc&quot;;
companyID=&quot;com.abc&quot;;
companyURL=&quot;http://abc.com&quot;;
target=&quot;iphoneos&quot;;
#target=&quot;macosx&quot;;
outputPath=&quot;~/doc&quot;;#输出地址
# End constants
/usr/local/bin/appledoc \
--project-name &quot;${PROJECT_NAME}&quot; \
--project-company &quot;${company}&quot; \
--company-id &quot;${companyID}&quot; \
--docset-atom-filename &quot;${company}.atom&quot; \
--docset-feed-url &quot;${companyURL}/${company}/%DOCSETATOMFILENAME&quot; \
--docset-package-url &quot;${companyURL}/${company}/%DOCSETPACKAGEFILENAME&quot; \
--docset-fallback-url &quot;${companyURL}/${company}&quot; \
--output &quot;${outputPath}&quot; \
--publish-docset \
--docset-platform-family &quot;${target}&quot; \
--logformat xcode \
--keep-intermediate-files \
--no-repeat-first-par \
--no-warn-invalid-crossref \
--exit-threshold 2 \
&quot;${PROJECT_DIR}&quot;</code></pre>

    </article>
  </div>

  
  
  

  
</body>

</html>